{$wrapper_prefix|default}

<script src="{$_STATIC_URL}/admin/js/group.edit.js" type="text/javascript"></script>

<section class="hbox stretch">
    <aside class="aside-md bg-white b-r">
        <section class="vbox">
            <header class="b-b header">
                <p class="h4">{if $group}编辑角色{else}添加角色{/if}</p>
            </header>
            
            <section class="scrollable wrapper w-f">
                <form class="form-horizontal" id="edit_form" action="/admin/group/add" method="post">
                    {if false && ! $group}
                    <div class="form-group">
                        <label for="primary_id" class="col-sm-2 control-label">主键 ID</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="primary_id" name="primary_id" value="{$group.id}" placeholder="请输入主键 ID" />
                            <span class="help-block m-b-none">如果不填，则自动增长</span>
                        </div>
                    </div>
                    <div class="line line-dashed line-lg pull-in"></div>
                    {/if}
                    
                    {if ! $group || $group.groupid > 1}
                    <div class="form-group">
                        <label class="col-sm-2 control-label">父级角色</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="parentid">
                                <option value="0" {if $group.parentid == 0}selected{/if}>请选择父级角色</option>
                                {if $parent_groups}
                                {foreach from=$parent_groups item=v}
                                <option value="{$v.groupid}" {if $v.groupid == $group.parentid}selected{/if}>{$v.groupname}</option>
                                {/foreach}
                                {/if}
                            </select>
                        </div>
                    </div>
                    <div class="line line-dashed line-lg pull-in"></div>
                    {/if}
                        
                    <div class="form-group">
                        <label for="groupname" class="col-sm-2 control-label"><font class="red">* </font> 角色名</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" id="groupname" name="groupname" value="{$group.groupname}" placeholder="请输入角色名" />
                        </div>
                    </div>
                    <div class="line line-dashed line-lg pull-in"></div>
                        
                    <div class="form-group">
                        <label for="description" class="col-sm-2 control-label">描述</label>
                        <div class="col-sm-4">
                            <textarea name="description" id="description" class="form-control" rows="3" placeholder="请输入描述">{$group.description}</textarea>
                        </div>
                    </div>
                    
                    <input type="hidden" name="groupid" value="{$group.groupid}" />
                </form>
            </section>
            
            <footer class="footer b-t bg-white-only">
                <div class="m-t-sm">
                    <button type="button" id="submit_save_back" class="btn btn-s-md btn-primary btn-sm input-submit">保存</button>
                    {if ! $group}<button type="button" id="submit_save_continue" class="btn btn-s-md btn-primary btn-sm input-submit">保存并继续添加</button>{/if}
                    <button type="button" id="submit_cancel" class="btn btn-danger btn-sm input-submit">取消</button>
                    <span id="edit_notice"></span>
                </div>
            </footer>
        </section>
    </aside>
</section>

{$wrapper_suffix|default}